import os

from alipay import AliPay
from django.conf import settings

# 创建支付宝对象
alipay = AliPay(
    appid=settings.ALIPAY_APPID,
    app_notify_url=None,  # 默认回调地址
    app_private_key_path=os.path.join(settings.BASE_DIR, 'apps/payment/key/app_private_key.pem'),
    alipay_public_key_path=os.path.join(settings.BASE_DIR, 'apps/payment/key/alipay_public_key.pem'),
    sign_type="RSA2",
    debug=settings.ALIPAY_DEBUG,
)
